/*
 * @Author: Dufen~123 dufen.0
 * @Date: 2024-11-28 11:37:54
 * @LastEditors: Dufen~123 dufen.0
 * @LastEditTime: 2024-11-28 18:11:16
 * @FilePath: \my-project\src\App.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React, { useState } from 'react';
import CommonSider from './components/commonSider/commonSider';
import {  Layout } from 'antd';
import Header from './components/CommonHeader/CommonHeader';
import CommonFooter from './components/commonFooter/commonFooter';
import { Outlet } from 'react-router-dom';
// import CommConent from './components/commConent/commConent';
import './App.css';
 
export default function App() {
  const [collapsed, setCollapsed] = useState(false);
  const [isActive, setIsActive] = useState(0)
 
  function clickMenu(path, menuId) {
    console.log(path, menuId,'菜单')
    // if (isActive === menuId) {
    //   return
    // }
    console.log(path, menuId,'菜单')
    console.log(isActive,path, menuId,'菜单')
    // 保存当前点击的菜单ID
    setIsActive(menuId)
  }
 
  return (
    <div className="App">
      <CommonSider collapsed={collapsed}></CommonSider>
      <Layout>
        <Header clickMenu={clickMenu} active={isActive} collapsed={collapsed}></Header>
        <div className="content">
       
        <Outlet />
        
       
        </div>
        <CommonFooter></CommonFooter>
      </Layout>
    
    </div>
  );
}
